package com.fowo.api.walmart.config;

import cn.hutool.core.text.csv.CsvReadConfig;

import java.util.LinkedHashMap;
import java.util.Map;

public class WalmartCsvReadConfig {

    /**
     * 产品报表配置
     * @return
     */
    public static CsvReadConfig setItemReadConfig(){
        CsvReadConfig csvReadConfig = new CsvReadConfig();
        csvReadConfig.setContainsHeader(true);
        csvReadConfig.setSkipEmptyRows(true);

        Map<String,String> headerAlias = new LinkedHashMap<>();
        headerAlias.put("SKU","msku");
        headerAlias.put("Item ID","itemId");
        headerAlias.put("Product Name","title");
        headerAlias.put("Lifecycle Status","lifecycleStatus");
        headerAlias.put("Publish Status","publishedStatus");
        headerAlias.put("Status Change Reason","statusChangeReason");
        headerAlias.put("Product Category","productCategory");
        headerAlias.put("Price","priceAmount");
        headerAlias.put("Currency","priceCurrency");
        headerAlias.put("Buy Box Item Price","buyBoxItemPrice");
        headerAlias.put("Buy Box Shipping Price","buyBoxShippingPrice");
        headerAlias.put("Buy Box Eligible","buyBoxEligible");
        headerAlias.put("MSRP","msrp");
        headerAlias.put("Product Tax Code","productTaxCode");
        headerAlias.put("Ship Methods","shipMethods");
        headerAlias.put("Shipping Weight","shippingWeight");
        headerAlias.put("Shipping Weight Unit","shippingWeightUnit");
        headerAlias.put("Fulfillment Lag Time","fulfillmentLagTime");
        headerAlias.put("Fulfillment Type","fulfillmentType");
        headerAlias.put("WFS Sales Restriction","wfsSalesRestriction");
        headerAlias.put("WPID","wpid");
        headerAlias.put("GTIN","gtin");
        headerAlias.put("UPC","upc");
        headerAlias.put("Item Page URL","itemPageURL");
        headerAlias.put("Primary Image URL","primaryImageURL");
        headerAlias.put("Shelf Name","shelfName");
        headerAlias.put("Primary Category Path","primaryCategoryPath");
        headerAlias.put("Brand","brand");
        headerAlias.put("Offer Start Date","offerStartDate");
        headerAlias.put("Offer End Date","offerEndDate");
        headerAlias.put("Item Creation Date","itemCreationDate");
        headerAlias.put("Item Last Updated","itemLastUpdated");
        headerAlias.put("Reviews Count","reviewsCount");
        headerAlias.put("Average Rating","averageRating");
        headerAlias.put("Searchable?","searchable");
        headerAlias.put("Variant Group Id","variantGroupId");
        headerAlias.put("Primary Variant?","primaryVariant");
        headerAlias.put("Variant Grouping Attributes","variantGroupingAttributes");
        headerAlias.put("Variant Grouping Values","variantGroupingValues");
        headerAlias.put("Competitor URL","competitorURL");
        headerAlias.put("Competitor Price","competitorPrice");
        headerAlias.put("Competitor Ship Price","competitorShipPrice");
        headerAlias.put("Competitor Last Date Fetched","competitorLastDateFetched");
        headerAlias.put("Repricer Strategy","repricerStrategy");
        headerAlias.put("Minimum Seller Allowed Price","minimumSellerAllowedPrice");
        headerAlias.put("Maximum Seller Allowed Price","maximumSellerAllowedPrice");
        headerAlias.put("Repricer Status","repricerStatus");
        csvReadConfig.setHeaderAlias(headerAlias);
        return csvReadConfig;
    }

    /**
     * 库存报表配置
     * @return
     */
    public static CsvReadConfig setInventoryReadConfig() {
        CsvReadConfig csvReadConfig = new CsvReadConfig();
        csvReadConfig.setContainsHeader(true);
        csvReadConfig.setSkipEmptyRows(true);
        return csvReadConfig;
    }
}
